#pragma once
#include <float.h>


#define ReleaseCOM(x)	{ if(x) { x->Release(); x=0;}}

class App;
extern App * gApp;

struct IDirect3DDevice9;
extern IDirect3DDevice9 * gD3D;

#define HR(x)                                      \
	{                                              \
	HRESULT hr = x;                                \
	if(FAILED(hr))                                 \
		{                                          \
		DXTRACE_ERR(#x, hr);                       \
		}                                          \
	}

#ifdef _DEBUG
#define COUT(x) std::cout<<x
#else
#define COUT(X)
#endif


const float INFINITY = FLT_MAX;
const float EPSILON = 0.001f;

extern BYTE* bob; //In mesh I'm using this to store a template.. this needs to be destroyed ASAP